<html>
  <head>
  	<title>互助方式2</title>
  	<script type="text/javascript" src="./js/jquery.js"></script>
    <link rel="stylesheet" type="text/css" href="./bootstrap/css/bootstrap.css">
    <script type="text/javascript" src="./bootstrap/bootstrap.js"></script>
  	<style type="text/css">
  		fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}
  	</style>
  	<script type="text/javascript">
  	var mapNum=0;
		window.onload=function(){
			iosIframeWidthBug();
			var showDataDiv=$('#showDataDiv');
				var strToobj=[{'昵称':'顺手领个淘金币','推广链接':'1'},
								{'昵称':'','推广链接':''}];
				shuffle(strToobj);
				var newMap={'昵称':'顺手领个淘金币','推广链接':'https://market.m.taobao.com/apps/market/tjb/index.html'};
				strToobj.push(newMap);
				var mytime = setInterval(function(){getHTML(strToobj,showDataDiv);},2000);
				setTimeout(function() {
					clearInterval(mytime);
				}, strToobj.length*2000+2000);
		}
		function getHTML(strToobj,showDataDiv){
			var screenWidth = window.screen.availWidth*0.7;
			mapObj=strToobj[mapNum];
			if(mapObj== undefined){
				return false;
			}
			var username=mapObj['昵称'];
			var userlink=mapObj['推广链接'];
			var html ='';
			if (!navigator.userAgent.match(/iPad|iPhone/i))html ='<br/><fieldset style="width: 450px !important;height:720px;" scrolling="no" '
				+' security="restricted" sandbox="allow-scripts allow-same-origin allow-popups"'
				+'><legend>'+username +'</legend><iframe id="frameId'+mapNum+'" src ="'+userlink
				+'" height="640px" width="100%" ></iframe></fieldset>';
			else html ='<br/><fieldset style="width: '+screenWidth+'px;height:'+(screenWidth*1.5+30)+'px" scrolling="no" '
				+' security="restricted" sandbox="allow-scripts allow-same-origin allow-popups"'
				+'><legend>'+username +'</legend><iframe id="frameId'+mapNum+'" src ="'+userlink
				+'" height="'+(screenWidth*1.5*0.9)+'px !important" width="'+(screenWidth*0.9)+'px !important" style="overflow: hidden;"></iframe></fieldset>';
			showDataDiv.append(html);
			mapNum++;
		}
		function shuffle(arr) {
			var i, j,temp;
			for (i = arr.length - 1; i > 0; i--) {
				j = Math.floor(Math.random() * (i + 1));
				temp = arr[i];
				arr[i] = arr[j];
				arr[j] = temp;
			}
			return arr;
		};
		/*修复ios iframe width bug*/
		function iosIframeWidthBug(){
		    //不是 iphone ipad就不执行了
		    if (!navigator.userAgent.match(/iPad|iPhone/i))
		        return false;
			$('#bodyId').css("width",window.screen.availWidth);
		}
  	</script>
  </head>
  <body id="bodyId">
	<a href="https://h5.m.taobao.com/mlapp/olist.html" style="font-size:28px;margin-left:100px">淘宝登录</a>
	<br/><label style="font-size:28px;color:red;">如果没有登录请先点上面链接登录，原来同时打开怕淘宝检测到，现在2秒钟打开一个，所以打开后等20几秒吧</label>
  <br/>
  <div id="showDataDiv"></div>
  </body>
</html>
